/*
    Project:        Home Power Control
    File:           HPCStation.h
    Author:         christian@karunamusic.at
    Date:           12.2014
    Description:    A collection of units grouped together - main class for the station.
 */

#ifndef HPCSTATION_H
#define HPCSTATION_H

#include <vector>
#include "HPCLogScreen.h"
#include "HPCLogFile.h"

class HPCDatabase;
class HPCUnit;


/** \brief A collection of units grouped together.
 * Main class for the station managed by this Raspberry Pi.
 */
class HPCStation
{
public:
    /** \brief Constructor.
     * Constructs the station with arguments from main.
     * Setup of unit and sensors is read from the database.
     *
     * \param argc number of arguments.
     * \param argv[] array of arguments.
     *
     */
    HPCStation( int argc, char *argv[] );
    /** \brief Destructor.
     */
    virtual ~HPCStation();

    /** \brief Add a unit to the station.
     *
     * \param unit Unit to add.
     * \return HPCStation.
     *
     */
    virtual HPCStation& operator += ( HPCUnit* unit );

private:
    HPCDatabase  *m_DB; /**< The database. */
    HPCLogScreen *m_LogScreen; /**< Log to screen. */
    HPCLogFile   *m_LogFile; /**< Log to file. */

    std::vector<HPCUnit*> m_Units; /**< Vector with all units of the station. */
};

#endif // HPCSTATION_H
